<template>
	<view @click="close" class="mask">
		<view @click.stop="onClick" class="content">
			<view class="mainpadding_top">
				<view class="flexbetween">
					<view class="titletext sanshier xiaobai fonweight">通话结束</view>
					<view class=""@click.stop="close">
						<u-icon name="close" color="#fff" size="20"></u-icon>
					</view>
				</view>
				<view class="margin_top5 xiaobai flexleft ershiba">
					<view class="">累计通话时长：</view>
					<view class="xiaolan">{{time}}</view>
				</view>
				<view class="margin_top xiaobai flexleft ershiba">
					<view class="">累计{{xf?"消费":"获得"}}金币：</view>
					<view class="xiaolan">{{xfjb}}</view>
				</view>
				<view class="margin_top6">
					<text class="buttombtn textcenter xiaobai" @click.stop="close">确定</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				xf: "", //是否是消费
				time: "", //通话时常
				xfjb: "", //消费金币
			}
		},
		onLoad(options) {
			console.error("走进来我这个页面了");
			let data = JSON.parse(decodeURIComponent(options.msg))
			this.xf = data.xf
			this.time = data.time
			this.xfjb = data.xfjb
		},
		methods: {
			onClick(e) {
				// #ifdef APP-NVUE
				e.stopPropagation()
				// #endif
			},
			convertSecondsToHMS(seconds) {
			  var hours = Math.floor(seconds / 3600);
			  var minutes = Math.floor((seconds % 3600) / 60);
			  var remainingSeconds = seconds % 60;
			  let hourstext = hours?Number(hours).toFixed(0)+"小时":""
			  let minutestext = minutestext?Number(minutestext).toFixed(0)+"分钟":""
			  let remainingSecondstext = remainingSeconds?Number(remainingSeconds).toFixed(0)+"秒":""
			  return hourstext + minutestext + remainingSecondstext
			},
			close() {
				uni.navigateBack()
			}
		}
	}
</script>

<style>
	.buttombtn {
		display: block;
		width: 690rpx;
		border-radius: 50rpx;
		background-color: #2261ff;
		padding: 20rpx 0;
	}
	page {
		background: transparent;
	}

	.mask {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
		background-color: rgba(0, 0, 0, 0.4);
	}

	.content {
		border-radius: 20rpx 20rpx 0 0;
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 200px;
		background-color: #282828;
	}

	.text {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		line-height: 200px;
		text-align: center;
		color: #FFFFFF;
	}
</style>